<img src="<?php echo $row[];?>">无法输出图片

来源:百度知道 编辑:UC知道 时间:2024/06/21 00:16:05
图片无法输出,什么东西也没有,红叉叉也没有,还有一个奇怪的现象就是
<a><img></a>哪里输出别的什么也输出不了我想直接<img src="...">也没用
<?php
$str="select * from product where sortid=5 order by addtime desc limit 0,7";
$result=mysql_query($str);
$row = mysql_fetch_array($result);
if(!$row){
?>
<span>抱歉,暂时没有商品!</span>
<?php
}
else{
while($row = mysql_fetch_array($result)){
?>
<a href="information.php?id="<?php echo $row['productid']?>>
<img src="<?php echo $row['thumb']?>"/>
</a>
<?php
}
}
?>

你查看网页源代码 看一下。(最终输出的网页源代码)

src 里面有没有值,有什么值,是不是正确的?

while($row = mysql_fetch_array($result)){
后面加个打印的函数试试 $row 里面有没有值

print_r($row);

看图片路径

print_r($row);